home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / SNDLIST- / READ_ME_.(TE < prev    next >
Text File  |  1988-11-10  |  4KB  |  76 lines

  1. Documentation for "SndList" version 1.1 (10-Nov-88)
  2. ===================================================
  3.  
  4. Requirements
  5. ------------
  6.  
  7. The minimum configuration is a Macintosh Plus and System Software 6.0. 
  8. Anyhow if "SndList" is started it checks if the "_SndPlay" trap is 
  9. implemented and refuses to continue if not. "SndList" is MultiFinder aware.
  10.  
  11. What you get
  12. ------------
  13.  
  14. "SndList" opens the resource fork of the file you specify, and displays a 
  15. scrolling list of all sound resources (resource type 'snd ') it finds. You 
  16. can have open up to 5 files at the same time. The windows with the lists 
  17. can be moved around on the screen as you like. You can select one ore more 
  18. sounds from this list using standard Macintosh selecting techniques 
  19. (clicking, shift clicking, option clicking). To play the sounds selected 
  20. simply click on the "Play" button in the window, or press "Return" or 
  21. "Enter", or double click while selecting the sounds. The sounds are played 
  22. by calling the Macintosh toolbox trap "_SndPlay". All types of sound 
  23. resources can be played: type 1 (e.g. beep sounds from the System file), 
  24. type 2 (e.g. sounds from HyperCard stacks).
  25.  
  26. There is also a scrollbar like control in the window where you can set the 
  27. volume level for the speaker. The default volume level is the one you have 
  28. set up using the control panel.
  29.  
  30. But there is more
  31. -----------------
  32.  
  33. When I tried to play sound resources using the "_SndPlay" trap, that became 
  34. available on my Macintosh Plus starting with System 6.0, I noticed that a 
  35. lot of sounds I had on public domain disks would not play at the correct 
  36. pitch. So there is a hidden option in "SndList" which enables you to patch 
  37. the sound resources. If you press the "Option" key while pressing the 
  38. "Play" button (or while double clicking, or pressing "Return" or "Enter") a 
  39. modal dialog window appears on top of the sound list window, where you can 
  40. modify the sampling rate and the base note of the sound resource. Simply 
  41. enter new values in the fields labeled "Sampling rate" or "Base note". You 
  42. can also click on the above texts to normalize the sampling rate and the 
  43. base note. This means that the sampling rate gets adjusted so that the base 
  44. note becomes exactly 60 (middle-C). The formula for doing this is:
  45.  
  46. Sampling rate = Sampling rate * exp2((60 - Base note)/12)
  47. Base note = 60
  48.  
  49. E.g. the original sampling rate is 22254.545471, and the base note is 72 
  50. (one octave above middle-C), but when you play the sound it's pitch seems 
  51. to be too high. Click on the text "Sampling rate" or "Base Note" and the 
  52. sampling rate changes to 11127.272736 and the base note to 60. Now the 
  53. sound should play ok.
  54.  
  55. This patching only works for 'sound resources which use the sampled sound 
  56. synthesizer, and only for the first sampled sound buffer found in the sound 
  57. resource (for type 1 sounds the program looks for the first "bufferCmd" 
  58. command, and for type 2 sounds the program looks for the first "soundCmd" 
  59. command). For more details about the exact structure of sound resources see 
  60. the Sound Manager chapter of Inside Macintosh Volume V.
  61.  
  62. SndINIT
  63. -------
  64.  
  65. If you want to have sounds played automatically when the Macintosh is 
  66. started up, there is nice way to accomplish this. I have included an INIT 
  67. resource in the file "SndINIT". This INIT shows it's icon and then plays 
  68. all sound resources from its resource fork. Use ResEdit to put the INIT 
  69. resource into the "Sound" cdev file in the system folder. Clear the "no 
  70. init" bit of the "Sound" cdev file. Copy the sound resources you want into 
  71. the "Sound" cdev. You can test the sounds by simply using "Sound" from the 
  72. control panel (but you cannot use these sounds as system beeps). Note: this 
  73. works only for System 6.0 or later, if you have a Macintosh Plus (because 
  74. the "_SndPlay" trap must be available).
  75.  
  76.